/**
 * @Copyright:Copyright (c) 1992 - 2016
 * @Company: TengTong
 */

package com.tengtong.duang.web.servlet.impl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tengtong.duang.web.commons.ClientRequestMethod;
import com.tengtong.duang.web.commons.WebRequest;
import com.tengtong.duang.web.commons.WebRequestContext;
import com.tengtong.duang.web.commons.WebResponse;

/**
 * @author mling
 *
 */
public class WebRequestContextImpl implements WebRequestContext{
	
	private final WebRequest request;
	
	private final WebResponse response;

	/**
	 * @param requestMethod
	 * @param req
	 * @param resp
	 */
	public WebRequestContextImpl(ClientRequestMethod requestMethod, 
									HttpServletRequest req, HttpServletResponse resp) {
		this.request = ServletWebRequestImpl.createInstance(req);
		this.response = ServletWebResponseImpl.createInstance(resp);
		
	}

	/* (non-Javadoc)
	 * @see com.tengtong.duang.web.commons.WebRequestContext#getRequest()
	 */
	@Override
	public WebRequest getRequest() {
		return request;
	}

	/* (non-Javadoc)
	 * @see com.tengtong.duang.web.commons.WebRequestContext#getResponse()
	 */
	@Override
	public WebResponse getResponse() {
		return response;
	}

}
